package com.ybwh.springboot1.model.po;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import lombok.Data;

/**
*
*/
@Data
@Entity 
@Table(name = "t_work_message", uniqueConstraints = { @UniqueConstraint(columnNames = { "id" }) })
public class WorkMessage {

	/**
	*主键
	*/
	@Id
	@SequenceGenerator(name = "t_work_message")
	@Column(name = "id")
	private Long id;
	
	/**
	*消息类型。10-考勤之上班打卡提醒；11-考勤之下班打卡提醒；12-考勤之上班迟到报警；13-考勤之今日迟到员工；14-考勤之昨日缺卡；15-考勤之本月异常考勤；16-考勤之排班提醒；20-审批之审批提醒；30-提成之提成更新提醒；40-会议室之会议室预定成功
	*/
	@Column(name = "type")
	private Integer type;
	
	/**
	*消息名称(应用名称)
	*/
	@Column(name = "name")
	private String name;
	
	/**
	*logo地址
	*/
	@Column(name = "logo_url")
	private String logoUrl;
	
	/**
	*消息标题
	*/
	@Column(name = "title")
	private String title;
	
	/**
	*消息内容
	*/
	@Column(name = "content")
	private String content;
	
	/**
	*消息状态。0-未推送成功，1-已推送
	*/
	@Column(name = "state")
	private Integer state;
	
	/**
	*消息状态。0-未读，1-已读
	*/
	@Column(name = "is_read")
	private Integer isRead;
	
	/**
	*消息链接
	*/
	@Column(name = "link")
	private String link;
	
	/**
	*接收消息的员工ID
	*/
	@Column(name = "employee_id")
	private Long employeeId;
	
	/**
	*推送渠道.1-小米/0-信鸽,-1：因版本问题没有推送或历史数据
	*/
	@Column(name = "push_channel")
	private Integer pushChannel;
	
	/**
	*推送时间
	*/
	@Column(name = "push_time")
	private Date pushTime;
	
	/**
	*数据创建时间
	*/
	@Column(name = "create_ts")
	private Date createTs;
	
	/**
	*消息的额外信息.格式为json，用于对特殊消息附加一些参数或其他额外信息。
	*/
	@Column(name = "extra")
	private String extra;
	
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
	}
}